package com.wangxiaonan.wxwork.service;

import com.wangxiaonan.wxwork.domain.ScheduleJob;
import com.wangxiaonan.wxwork.exeption.ServiceException;
import org.quartz.JobKey;

import java.util.Date;
import java.util.List;

/**
 * 定时任务服务
 *
 * @Author: wangxiaonan
 * @Date: 2018/8/29
 **/
public interface ScheduleService {

    ScheduleJob getScheduleJobById(Integer id);

    List<ScheduleJob> getScheduleJobs(ScheduleJob scheduleJob);

    List<ScheduleJob> getScheduleJobsWithBLOBs(ScheduleJob scheduleJob);

    ScheduleJob save(ScheduleJob scheduleJob);

    ScheduleJob updateSchedule(ScheduleJob scheduleJob);

    int update(ScheduleJob scheduleJob);

    int update(List<ScheduleJob> scheduleJobs);

    int deleteById(Integer id);

    int delete(ScheduleJob scheduleJob);

    int delete(List<ScheduleJob> scheduleJobs);

    void clearJob() throws ServiceException;

    Date scheduleJob(ScheduleJob job) throws ServiceException;

    boolean reScheduleJob(ScheduleJob job) throws ServiceException;

    boolean unScheduleJob(ScheduleJob job) throws ServiceException;

    boolean unScheduleJobs(List<ScheduleJob> jobs) throws ServiceException;

    boolean checkExists(JobKey jobKey) throws ServiceException;

}
